home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 46
/
Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso
/
-serious-
/
programming
/
other
/
tandem
/
teaching
/
10.asm
< prev
next >
Wrap
Assembly Source File
|
1999-09-06
|
640b
|
16 lines
* 10.asm Subroutine to convert a-z to A-Z version 0.00 1.9.97
move.b #'c',d0 ;try various things here
bsr Upper
rts
* if d0=a-z, convert to A-Z (and ignore non-alphabetic characters)
Upper:
cmp.b #'a',d0 ;BRA extension .B means "byte" - max jump 126 bytes
bcs.s Up_done ;BRA extension .W means "word" - max jump 32766 bytes
cmp.b #'z'+1,d0 ;use .S where possible, since it's quicker & shorter
bcc.s Up_done ;default for forward jumps is .L, so put .S if short
add.b #'A'-'a',d0 ; Tandem selects .B or .W automatically for backward
Up_done: ; jumps, so omit .B or .W for backward jumps
rts